home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.*;
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CThingMain extends CThingAffect
- {
-
- public static const REACHEDOBJECTIVE:String = "REACHEDOBJECTIVE";
-
- public static var mFurthestMostEnemy:CThingMain;
-
- public static var mFurthestMostFriend:CThingMain;
-
- {
- if(true)
- {
- REACHEDOBJECTIVE = "REACHEDOBJECTIVE";
- }
- }
-
- public var mCurrentTarget:CThingMain;
-
- public var mTargetAngle:CAngle;
-
- public var mTargetCloseRange:Number;
-
- public var mTargetAirbourne:Boolean;
-
- public var FILTER_Target:Function;
-
- internal var mWeaponDelta:CPosition;
-
- public var mTargetLOS:Boolean;
-
- public var mReachedObjective:Boolean;
-
- public var mTargetRange:Number;
-
- public var mDisposable:Boolean;
-
- public var mTargetRangeSQR:Number;
-
- public function CThingMain()
- {
- if(true)
- {
- super();
- }
- }
-
- public function get mBaseDamage() : Number
- {
- return 0;
- }
-
- public function GetTargetRange(param1:CThingMain) : Number
- {
- return mPosition.Distance(param1.mPosition);
- }
-
- public function Process_ReachedObjective() : Boolean
- {
- §§push(mGroupID == GROUPID_FRIEND);
- §§push(mGroupID == GROUPID_FRIEND);
- if(true)
- {
- if(§§pop())
- {
- §§pop();
- §§push(mPosition.x > mLandscape.mWidth + 100);
- }
- if(§§pop() || mGroupID == GROUPID_ENEMY && mPosition.x < -100)
- {
- mReachedObjective = true;
- dispatchEvent(new Event(REACHEDOBJECTIVE));
- DispatchDispose();
- IncrementReachedObjective();
- return true;
- }
- return false;
- }
- §§goto(addr38);
- }
-
- public function GetTarget() : CThingMain
- {
- var _loc1_:* = NaN;
- var _loc2_:CCell = null;
- var _loc3_:CThingMain = null;
- if(true)
- {
- §§push(Boolean(mCellCurrent));
- if(true)
- {
- §§push(§§pop());
- if(true)
- {
- if(§§pop())
- {
- if(true)
- {
- §§pop();
- if(true)
- {
- §§push(mCellCurrent.mDumbCell);
- if(true)
- {
- addr37:
- if(§§pop())
- {
- if(true)
- {
- §§push(null);
- if(true)
- {
- return §§pop();
- }
- }
- else
- {
- addr98:
- if(_loc1_ > mFurthestMostFriend.mPosition.x)
- {
- addr104:
- return null;
- }
- else
- {
- §§goto(addr106);
- }
- }
- return §§pop();
- }
- §§push(mPosition.x + (mTargetRange + mBloatCellSearch) * mOrientation);
- if(true)
- {
- _loc1_ = §§pop();
- if(true)
- {
- if(mGroupID == GROUPID_FRIEND)
- {
- if(true)
- {
- §§push(mFurthestMostEnemy == null);
- if(true)
- {
- §§push(§§pop() || _loc1_ < mFurthestMostEnemy.mPosition.x);
- }
- if(!§§pop())
- {
- addr81:
- §§goto(addr106);
- }
- }
- return null;
- }
- if(mGroupID == GROUPID_ENEMY)
- {
- addr95:
- §§push(mFurthestMostFriend == null);
- if(!(mFurthestMostFriend == null))
- {
- addr97:
- §§pop();
- }
- §§goto(addr98);
- }
- §§goto(addr106);
- §§goto(addr106);
- }
- §§goto(addr81);
- }
- §§goto(addr98);
- }
- §§goto(addr95);
- }
- §§goto(addr104);
- }
- §§goto(addr97);
- }
- §§goto(addr37);
- }
- §§goto(addr95);
- }
- §§goto(addr98);
- }
- addr106:
- for each(_loc2_ in mMap.GetCells(mPosition.x,_loc1_))
- {
- if(true)
- {
- var _loc6_:int = 0;
- if(true)
- {
- for each(_loc3_ in _loc2_.mMapwho)
- {
- if(false)
- {
- continue;
- }
- §§push(_loc3_.mGroupID == mGroupID);
- if(!(_loc3_.mGroupID == mGroupID))
- {
- §§pop();
- if(true)
- {
- addr154:
- if(_loc3_.mCollide == null)
- {
- if(true)
- {
- continue;
- }
- }
- else if(FILTER_Target(_loc3_))
- {
- if(ValidTarget(_loc3_))
- {
- return _loc3_;
- }
- addr167:
- continue;
- }
- continue;
- }
- §§goto(addr167);
- }
- §§goto(addr154);
- }
- }
- }
- }
- return null;
- }
-
- public function FILTER_AnyTarget(param1:CThingMain) : Boolean
- {
- return true;
- }
-
- public function LineOfSight(param1:CThingMain) : Boolean
- {
- var _loc2_:CPosition = null;
- var _loc3_:CPosition = null;
- _loc2_ = mCollide.mMid;
- _loc3_ = param1.mCollide.mMid;
- return mLandscape.LineOfSight(_loc2_.x,_loc2_.y,_loc3_.x,_loc3_.y);
- }
-
- public function ValidTarget(param1:CThingMain) : Boolean
- {
- if(true)
- {
- §§push(param1.mDead);
- §§push(param1.mDead);
- if(true)
- {
- if(!§§pop())
- {
- §§pop();
- if(true)
- {
- addr24:
- if(!param1.mInvisible)
- {
- if((param1.mPosition.x - mPosition.x) * mOrientation <= mTargetCloseRange)
- {
- if(true)
- {
- return false;
- }
- }
- else if(mPosition.DistanceSQR(param1.mPosition) <= mTargetRangeSQR)
- {
- addr63:
- §§push(mTargetLOS);
- if(mTargetLOS)
- {
- §§pop();
- §§goto(addr65);
- }
- addr76:
- if(§§pop())
- {
- §§goto(addr77);
- }
- else
- {
- §§goto(addr79);
- }
- }
- return false;
- }
- if(true)
- {
- return false;
- }
- addr65:
- §§push(!LineOfSight(param1));
- §§goto(addr76);
- }
- addr77:
- return false;
- }
- §§goto(addr24);
- }
- §§goto(addr63);
- }
- addr79:
- return true;
- }
-
- public function get mSmallPrize() : int
- {
- return 0;
- }
-
- public function DispatchDispose() : void
- {
- mInvisible = true;
- Process = Process_DisposeShotEffect;
- }
-
- public function FILTER_AirTargets(param1:CThingMain) : Boolean
- {
- return param1.mTargetAirbourne;
- }
-
- public function get mPrize() : int
- {
- return 0;
- }
-
- private function Process_DisposeShotEffect() : void
- {
- var _loc1_:* = 0;
- var _loc2_:* = undefined;
- §§push(0);
- if(true)
- {
- _loc1_ = §§pop();
- §§push(0);
- }
- for each(_loc2_ in mChildren)
- {
- if(false)
- {
- continue;
- }
- §§push(Boolean(_loc2_.mDisposable));
- if(Boolean(_loc2_.mDisposable))
- {
- §§pop();
- if(true)
- {
- addr50:
- if(!Boolean(_loc2_.Process))
- {
- continue;
- }
- _loc2_.Process();
- }
- _loc1_++;
- continue;
- }
- §§goto(addr50);
- }
- if(_loc1_ == 0)
- {
- Dispose();
- }
- }
-
- public function FILTER_GroundTargets(param1:CThingMain) : Boolean
- {
- §§push(param1.mTargetAirbourne);
- if(true)
- {
- §§push(!§§pop());
- }
- return §§pop();
- }
-
- public function SetTargetting(param1:Number, param2:Boolean, param3:Function, param4:Boolean = true, param5:Number = 0) : void
- {
- mTargetRange = param1;
- mTargetCloseRange = param5;
- mTargetRangeSQR = mTargetRange * mTargetRange;
- mTargetAirbourne = param2;
- mTargetLOS = param4;
- FILTER_Target = param3;
- }
- }
- }
-